import request from '@/utils/request'

// 查询出入库订单列表
export function listTask(query) {
  return request({
    url: '/oms/task/list',
    method: 'get',
    params: query
  })
}

// 初始化
export function initBean(data) {
  return request({
    url: '/oms/task/initBean',
    method: 'post',
    data: data
  })
}

export function initDealBean(data) {
  return request({
    url: '/oms/task/initDealBean',
    method: 'post',
    data: data
  })
}

// 查询出入库订单详细
export function getTask(id) {
  return request({
    url: '/oms/task/' + id,
    method: 'get'
  })
}

// 新增出入库订单
export function addTask(data) {
  return request({
    url: '/oms/task',
    method: 'post',
    data: data
  })
}

// 修改出入库订单
export function updateTask(data) {
  return request({
    url: '/oms/task',
    method: 'put',
    data: data
  })
}

// 删除出入库订单
export function delTask(id) {
  return request({
    url: '/oms/task/' + id,
    method: 'delete'
  })
}

// 修改出入库订单
export function delDtl(data) {
  return request({
    url: '/oms/task/removeDtl',
    method: 'post',
    data: data
  })
}

export function getStatisticsTask(query) {
  return request({
    url: '/oms/task/statisticsTask',
    method: 'get',
    params: query
  })
}

//恢复订单
export function restoreTask(id) {
  return request({
    url: '/oms/task/restoreTask/' + id,
    method: 'get'
  })
}

//撤销订单
export function removeTask(id, data) {
  return request({
    url: '/oms/task/removeTask/' + id,
    method: 'delete',
    params: data
  })
}

//撤销订单
export function removeTaskByAdmin(id, data) {
  return request({
    url: '/oms/task/removeTaskByAdmin/' + id,
    method: 'delete',
    params: data
  })
}

export function reviewOss(data) {
  return request({
    url: '/oms/task/reviewOss',
    method: 'post',
    data: data
  })
}

// 订单审核
export function check(data) {
  return request({
    url: '/oms/task/check',
    method: 'post',
    data: data
  })
}

// 订单审核
export function saveVideo(data) {
  return request({
    url: '/oms/task/uploadVideo',
    method: 'post',
    data: data
  })
}
export function disposalFinish(id) {
  return request({
    url: `/oms/task/disposal/finish/${id}`,
    method: 'post'
  })
}

export function getTaskVideoRecord(params) {
  return request({
    url: '/oms/task/videoRecord',
    method: 'get',
    params: params
  })
}

export function insertTaskVideoRecord(data) {
  return request({
    url: '/oms/task/videoRecord',
    method: 'post',
    data: data
  })
}

export function removeTaskVideoRecord(id) {
  return request({
    url: '/oms/task/videoRecord/' + id,
    method: 'delete'
  })
}
